package com.example.democlient.network;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


public final class ThreadPoolManager 
{

	public static final long MAXIMUM_RUNTIME_IN_MILLISEC_WITHOUT_WARNING = 5000;

	private final ExecutorService	instantPool;


	/**
	 * @return ThreadPoolManager instance.
	 */
	private static final class SingletonHolder
	{
		private static final ThreadPoolManager INSTANCE = new ThreadPoolManager();
	}
	
	public static ThreadPoolManager getInstance()
	{
		return SingletonHolder.INSTANCE;
	}

	/**
	 * Constructor.
	 */
	private ThreadPoolManager()
	{
		instantPool = Executors.newCachedThreadPool();
	}


	public void executeLsPacket(Runnable pkt)
	{
		instantPool.execute(pkt);
	}
}
